<?php
class filterApi extends baseApi{

	//构成菜单
	public function hook_menu_category(){
        return array(
            0 => array('name'=>'多维分类','url'=>url('admin_category/index'),'sequence'=>1),
            );
    }

    public function hook_purview_admin()
    {
        return array(
            'admin_category'=>array(
                'name'=>'多维分类',
                'auth'=>array(
                	'list'=>'列表',
                    'add'=>'添加',
                    'edit'=>'编辑',
                    'del'=>'删除',
                ),
            ),
        );
    }

	//多维分类列表
	public function class_list(){
		return model('filter_category')->filter_category_list();
	}

	//获取完整html录入信息
	public function get_filter_html($data){
		return model('filter_list')->get_filter($data['cid'],$data['aid'],$data['html']);
	}

	//多维分类条件数据
	public function hook_category_list_where($data){
		$info=$data['info'];
		return model('category_filter')->filter_data($info['filter'],$info['cid'],$data['app']);
	}
	
	//栏目信息HTML
	public function hook_admin_category_info_html($info=array()){
		echo model('filter_category')->filter_list_html($info);
	}

	//内容信息HTML
	public function hook_admin_content_info_top_html($info=array()){
		echo model('filter_list')->filter_info_html($info);
	}

	//内容栏目选择JS
	public function hook_admin_content_info_js_class($info=array()){
		echo model('filter_list')->filter_info_js_class($info);
	}

	//关联内容
	public function hook_admin_content_save_data($data){
		return model('filter_relation')->content_relation($data);
	}

	//删除关联内容
	public function hook_admin_content_del_foot_data($aid){
		return model('filter_relation')->del_content_relation($aid);
	}

	//多维分类sql语句
	public function hook_content_list_sql($info=array()){
		return model('category_filter')->filter_sql($info['filter']);
	}
	
}